package leetcode;

public class Solution6 {

    public int distance(TreeNode root, TreeNode p1, TreeNode p2){
        // 公共祖先


         distance(root.left, p1, p2);

         return 0;

    }

    public TreeNode dis(TreeNode root,TreeNode p1,TreeNode p2){
        if (root == null || root == p1 || root == p2) {
            return root;
        }

        TreeNode left = dis(root.left, p1, p2);

        TreeNode right = dis(root.right, p1, p2);

        if (left == null && right != null) {

        }

        return null;
    }

    class TreeNode{
        int val;
        TreeNode left;
        TreeNode right;
    }
}
